package com.lnsf.bookstore.system.coupon.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.system.coupon.dao.CouponMapper;
import com.lnsf.bookstore.system.coupon.service.CouponService;
import com.lnsf.bookstore.system.coupon.vo.Coupon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service
public class CouponServiceImpl implements CouponService {

    @Autowired
    private CouponMapper couponMapper;

    @Override
    public PageInfo<Coupon> queryAll(Map<String, Object> params) {
        PageHelper.startPage(Integer.parseInt(params.get("page").toString()),Integer.parseInt(params.get("pageSize").toString()));
        return new PageInfo<Coupon>(couponMapper.selectAll(params));
    }
}
